package zwz.importTask.strategy.imporStrategy;


import org.springframework.stereotype.Service;
import zwz.importTask.VO.TypeAImportVO;
import zwz.importTask.strategy.AbstractExcelImportStrategy;

import java.util.List;

@Service
public class TypeAImportStrategy extends AbstractExcelImportStrategy<TypeAImportVO> {


    @Override
    public Class<TypeAImportVO> getTypeClass() {
        return TypeAImportVO.class;
    }

    @Override
    public boolean validateData(TypeAImportVO data) {
        return !"女".equals(data.getSex());// 校验逻辑
    }

    @Override
    public void handleSuccessData(List<TypeAImportVO> dataList) {
        //持久化
        System.out.println("处理数据：" + dataList.size() + " 条");
    }

    @Override
    public void handleFailureData(List<TypeAImportVO> failureList) {
        System.out.println("失败的数据：" + failureList.size() + " 条");
    }

    @Override
    public int getBatchSize() {
        return 500;
    }
}
